package org.emergency.framework.dao;

import org.hibernate.Query;
import org.hibernate.Session;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;


@Repository("utilDao")
public class UtilDao extends HibernateBaseDao implements IUtilDao{

	/**
	 * 
	 * @param hqlString  函数会根据hql语句来执行
	 */
	public void updatebyHQL(String hqlString){
		Session session = this.getSession();
		try{
			session.beginTransaction();
			Query query=session.createQuery(hqlString);
			query.executeUpdate();
			session.getTransaction().commit();
		}catch (Exception e) {
			System.out.println(e.toString());
		}finally{
		session.close();
		}
	}
}
